package vn.mahjonggame.util;
import java.util.Properties;
import java.util.Set;

public class PropertiesCache {
	
	private final Properties configProp = new Properties();
    
	/*
	 * Private constructor to restrict new instances
	 */
	private PropertiesCache() {
		
   	}
		
	private static class LazyHolder {
		private static final PropertiesCache INSTANCE = new PropertiesCache();
	}
	
	public static PropertiesCache getInstance() {
	    return LazyHolder.INSTANCE;
	}
	
	public String getProperty(String key){
		return configProp.getProperty(key);
    }
	
	public void setProperty(String key, String value){
		configProp.setProperty(key, value);
	}
	
	public Set<String> getAllPropertyNames(){
	    return configProp.stringPropertyNames();
	}
   
	public boolean containsKey(String key){
		return configProp.containsKey(key);
	}
}
